<template>
    <div style="display:inline-block">
        <el-input-number 
            @change="Change('change')"
            v-model="value" 
            :disabled="baseInfo.disabled" 
            :style="baseInfo.domCss" 
            :min="baseInfo.min"
            :max="baseInfo.max"></el-input-number>
        <span style="margin-left:8px">{{baseInfo.suffix}}</span>
    </div>
</template>

<script>
export default {
    props: {
        baseInfo: {
            type: Object,
            default: () => {
                return {
                    disabled: false,
                    domCss: '',
                    defaultValue: '',
                    suffix: '人'
                };
            }
        }
    },
    data(){
        return {
            value:""
        }
    },
    watch:{
        baseInfo:{
            deep:true,
            handler:function(v){
                this.value=this.baseInfo.defaultValue
            }
        }
    },
    created(){
        this.value=this.baseInfo.defaultValue
    },
    methods:{
        Change(type){
            this.$emit('EventHandler',type,this.baseInfo.key,this.value);
        }
    }
};
</script>

<style></style>
